<?php
/*
require "common.php";
$common=new Common();
$sql="SELECT * FROM `lunwen_dict`";
$html='';
$query=mysqli_query($common->startMysql(),$sql);
$info_arr=mysqli_fetch_all($query,MYSQLI_ASSOC);
foreach ($info_arr as $info_v){
    $html.='<div class="layui-form-item">
        <label class="layui-form-label">'.$info_v["blokType_cn"].'</label>
        <div class="layui-input-block">
            <input type="text" name="'.$info_v["blokType"].'" required  lay-verify="required" placeholder="请输入内容" autocomplete="off" class="layui-input">
        </div>
    </div>';
}

echo $html;


$sql="SELECT * FROM `lunwen_yuanfile` WHERE blokType='Thanks'";
$query=mysqli_query($common->startMysql(),$sql);
$info_arr=mysqli_fetch_all($query,MYSQLI_ASSOC);
echo $info_arr[0]["正文内容"];
*/


require_once "./phpexcel-master/Classes/PHPExcel.php";
require_once "./phpexcel-master/Classes/PHPExcel/IOFactory.php";
require_once "./phpexcel-master/Classes/PHPExcel/Reader/Excel5.php";
require_once "./phpexcel-master/Classes/PHPExcel/Writer/Excel5.php";
require "common.php";
ini_set('memory_limit', '1500M');

$filename = "ddj.xls";
$PHPReader = new \PHPExcel_Reader_Excel5();

// 载入文件

$PHPExcel = $PHPReader->load($filename);

// 获取表中的第一个工作表，如果要获取第二个，把0改为1，依次类推

$currentSheet = $PHPExcel->getSheet(0);

// 获取总列数

$allColumn = $currentSheet->getHighestColumn();

// 获取总行数

$allRow = $currentSheet->getHighestRow();

// 创建写入

$objWriter = new PHPExcel_Writer_Excel5($PHPExcel);

$ii = 0;

// 循环获取表中的数据，$currentRow表示当前行，从哪行开始读取数据，索引值从0开始

for ($currentRow = 1; $currentRow <= $allRow; $currentRow++) {

// 从哪列开始，A表示第一列

    for ($currentColumn = 'A'; $currentColumn <= $allColumn; $currentColumn++) {

// 数据坐标

        $address = $currentColumn . $currentRow;

// 读取到的数据，保存到数组$arr中

        $data[$currentRow][$currentColumn] = $currentSheet->getCell($address)->getValue();

    }

//修改表S1的内容

//根据实际业务中的内容框修改

}

$currentSheet->setCellValue("A2", "修改内容23");

$objWriter->save($filename);


